home *** CD-ROM | disk | FTP | other *** search
- /*•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- • •
- • File Name: •
- • ---------- •
- • •
- • Copyright © 1990 Apple Computer, Inc. All Rights Reserved •
- • •
- • Description •
- • ----------- •
- • This file contains the c language portion of the parasite. The •
- • parasite is what slows down your mac. •
- • •
- • History •
- • ------- •
- • •
- • Author Date Description •
- • ------------------------------------------------------------------ •
- • Kevin McEntee 2/20/90 Original Implementation •
- • •
- • •
- •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
- #include <Types.h>
-
- #pragma segment NUGG
-
-
- /*••••••••••••••••••••••••••••••••••••••••••
- • •
- • Structure showing the jump-trace •
- • exception stack frame. •
- • •
- ••••••••••••••••••••••••••••••••••••••••••*/
- typedef struct {
- short status_register;
- Ptr program_counter;
- short vector_offset;
- char byte0;
- char byte1;
- char byte2;
- char byte3;
- char byte4;
- char byte5;
- char byte6;
- char byte7;
- char byte8;
- char byte9;
- char byte10;
- char byte11;
- char byte12;
- char byte13;
- char byte14;
- char byte15;
- } a_trap_stack_frame;
-
-
-
- /*••••••••••••••••••••••••••••••••••••••••••
- • •
- • Comment Block. •
- • •
- ••••••••••••••••••••••••••••••••••••••••••*/
- Ptr get_a_trap_exception_vector();
- void save_system_a_trap_vector(Ptr vector);
- void TAKE_A_TRAP_EXCEPTION_VECTOR();
-
- Ptr get_a_trap_stack_frame_program_counter(a_trap_stack_frame *frame);
- Ptr GET_SAVED_A_TRAP_VECTOR();
- Handle GET_MASTER_A_TRAP_HANDLE();
- void SET_JUMP_TRACE_BIT();
- void TAKE_JUMP_TRACE_VECTOR(long sludge_factor);
-
-
-
- /*•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- • •
- • Identifier: start_sludging •
- • ----------- •
- • •
- • Description •
- • ----------- •
- • This function starts the sludging. It sets the jump-trace and •
- • a-trap exceptions to SLUDGE routines and sets the jump-trace bit •
- • in the status register. •
- • •
- • History •
- • ------- •
- • •
- • Author Date Description •
- • ------------------------------------------------------------------ •
- • Kevin McEntee 2/20/90 Original Implementation •
- • •
- • •
- •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
- void start_sludging(long sludge_factor)
- {
-
- save_system_a_trap_vector( get_a_trap_exception_vector() );
-
- TAKE_JUMP_TRACE_VECTOR(sludge_factor);
- TAKE_A_TRAP_EXCEPTION_VECTOR();
- SET_JUMP_TRACE_BIT();
- }
-
-
-
-
- /*•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- • •
- • Identifier: get_a_trap_exception_vector •
- • ----------- •
- • •
- • Description •
- • ----------- •
- • This function returns the current a-trap exception vector. •
- • •
- • History •
- • ------- •
- • •
- • Author Date Description •
- • ------------------------------------------------------------------ •
- • Kevin McEntee 2/20/90 Original Implementation •
- • •
- • •
- •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
- Ptr get_a_trap_exception_vector()
- {
- Handle vector;
-
-
- vector = (Handle) 0x28;
-
- return( *vector);
-
- }
-
-
-
- /*•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- • •
- • Identifier: HLL_ATRAP_EX •
- • ----------- •
- • •
- • Description •
- • ----------- •
- • HLL_ATRAP_EX stands for: High Level Language A-Trap Execution. •
- • This function is called by SLUDGE's atrap exception handler and •
- • returns the system value for the A-Trap exception handler, so the •
- • system can process the trap. •
- • •
- • History •
- • ------- •
- • •
- • Author Date Description •
- • ------------------------------------------------------------------ •
- • Kevin McEntee 2/20/90 Original Implementation •
- • •
- • •
- •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
- Ptr HLL_ATRAP_EX(Handle register_A0, a_trap_stack_frame *frame)
- {
-
- return(GET_SAVED_A_TRAP_VECTOR());
- }
-
-
- /*•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
- • •
- • Identifier: save_system_a_trap_vector •
- • ----------- •
- • •
- • Description •
- • ----------- •
- • This function saves the system a-trap exception vector so we can •
- • jump to it during a-trap processing. •
- • •
- • History •
- • ------- •
- • •
- • Author Date Description •
- • ------------------------------------------------------------------ •
- • Kevin McEntee 2/20/90 Original Implementation •
- • •
- • •
- •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
- void save_system_a_trap_vector(Ptr vector)
- {
- Handle master_handle;
-
- master_handle = GET_MASTER_A_TRAP_HANDLE();
-
- *master_handle = vector;
- }
-
-
-
-